package com.ibeeking.found.org.b.rest.controller.v1.feign;

import com.ibeeking.found.common.entity.DepartmentDTO;
import com.ibeeking.found.common.entity.query.DepartmentFeignQuery;
import com.ibeeking.found.org.b.rest.service.IDepartmentService;
import com.ibeeking.nematos.constants.enums.OperateLogTypeEnum;
import com.ibeeking.nematos.log.annotation.Log;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * @ClassName  EmployeeFeignController
 * @Description
 * @Author ibeeking
 * @Date 2021-01-07 12:58
 **/
@RestController
@RequestMapping("/b/org/feign/v1")
public class OrgFeignController {

    @Resource
    private IDepartmentService departmentServiceImpl;

    /**
     * @param query
     * @return
     */
    @Log(logType = OperateLogTypeEnum.QUERY, describe = "查询员工")
    @PostMapping(value = "/queryOrgList")
    public List<DepartmentDTO> queryOrgList(@RequestBody DepartmentFeignQuery query) {
        return departmentServiceImpl.feignQueryDepatmentList(query);
    }
    /**
     * @param orgId
     * @return
     */
    @Log(logType = OperateLogTypeEnum.QUERY, describe = "查询组织信息")
    @PostMapping(value = "/queryOrg/{orgId}")
    public DepartmentDTO queryOrg(@PathVariable("orgId") Long orgId) {
        return departmentServiceImpl.feignQueryDepatment(orgId);
    }

}